package com.siwei.mes.enums;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;

import java.util.Arrays;

/**
 * @Description: 抗滲等級枚举
 * @Version: 1.0
 * @author: yangke
 * @date: 2025/05/14 22:16
 */
@Getter
public enum KsLqEnum {
    P6(1, "P6", 3),
    P8(2, "P8", 4),
    P10(3, "P10", 5),
    P12(4, "P12", 6);

    @ApiModelProperty(value = "类型id")
    private Integer code;

    @ApiModelProperty(value = "水泥试验项目名称")
    private String name;

    @ApiModelProperty(value = "水泥试验项目类型")
    private int lq;

    KsLqEnum(Integer code, String name, int lq) {
        this.code = code;
        this.name = name;
        this.lq = lq;
    }

    /**
     * 根据code查找信息
     *
     * @param name 抗滲等級
     * @return
     */
    public static KsLqEnum selectByName(String name) {
        return Arrays.stream(values()).filter(e -> e.getName().equals(name)).findFirst().orElse(null);
    }
}
